using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Versions
{
    /// <summary>
    /// <para>Create Version</para>
    /// <para>Creates a new version in the specified geodatabase.</para>
    /// <para>在指定的地理数据库中创建新版本。</para>
    /// </summary>    
    [DisplayName("Create Version")]
    public class CreateVersion : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public CreateVersion()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_workspace">
        /// <para>Input Workspace</para>
        /// <para><xdoc>
        ///   <para>The enterprise geodatabase that contains the parent version and will contain the new version.</para>
        ///   <para>For branch versioning, use a feature service URL (that is, https://mysite.mydomain/server/rest/services/ElectricNetwork/FeatureServer).</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>包含父版本并将包含新版本的企业级地理数据库。</para>
        ///   <para>对于分支版本控制，请使用要素服务 URL（即 https://mysite.mydomain/server/rest/services/ElectricNetwork/FeatureServer）。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_parent_version">
        /// <para>Parent Version</para>
        /// <para>The geodatabase, or version of a geodatabase, on which the new version will be based.</para>
        /// <para>新版本将基于的地理数据库或地理数据库版本。</para>
        /// </param>
        /// <param name="_version_name">
        /// <para>Version Name</para>
        /// <para>The name of the version to be created.</para>
        /// <para>要创建的版本的名称。</para>
        /// </param>
        public CreateVersion(object _in_workspace, object _parent_version, object _version_name)
        {
            this._in_workspace = _in_workspace;
            this._parent_version = _parent_version;
            this._version_name = _version_name;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Create Version";

        public override string CallName => "management.CreateVersion";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_workspace, _parent_version, _version_name, _access_permission.GetGPValue(), _out_workspace];

        /// <summary>
        /// <para>Input Workspace</para>
        /// <para><xdoc>
        ///   <para>The enterprise geodatabase that contains the parent version and will contain the new version.</para>
        ///   <para>For branch versioning, use a feature service URL (that is, https://mysite.mydomain/server/rest/services/ElectricNetwork/FeatureServer).</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>包含父版本并将包含新版本的企业级地理数据库。</para>
        ///   <para>对于分支版本控制，请使用要素服务 URL（即 https://mysite.mydomain/server/rest/services/ElectricNetwork/FeatureServer）。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Workspace")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_workspace { get; set; }


        /// <summary>
        /// <para>Parent Version</para>
        /// <para>The geodatabase, or version of a geodatabase, on which the new version will be based.</para>
        /// <para>新版本将基于的地理数据库或地理数据库版本。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Parent Version")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _parent_version { get; set; }


        /// <summary>
        /// <para>Version Name</para>
        /// <para>The name of the version to be created.</para>
        /// <para>要创建的版本的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Version Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _version_name { get; set; }


        /// <summary>
        /// <para>Access Permission</para>
        /// <para><xdoc>
        ///   <para>The permission access level for the version to protect it from being edited or viewed by users other than the owner.</para>
        ///   <bulletList>
        ///     <bullet_item>Private (owner only)—Only the owner or the geodatabase administrator can view and modify the version or versioned data.</bullet_item><para/>
        ///     <bullet_item>Public (any user)—Any user can view the version. Any user who has been granted read/write (update, insert, and delete) permissions on datasets can modify datasets in the version.</bullet_item><para/>
        ///     <bullet_item>Protected (only the owner can edit)—Any user can view the version, but only the owner or the geodatabase administrator can edit the version or datasets in the version.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>版本的权限访问级别，用于防止所有者以外的用户对其进行编辑或查看。</para>
        ///   <bulletList>
        ///     <bullet_item>私有（仅限所有者）- 只有所有者或地理数据库管理员才能查看和修改版本或版本化数据。</bullet_item><para/>
        ///     <bullet_item>公开（任何用户）- 任何用户都可以查看版本。任何被授予数据集读/写（更新、插入和删除）权限的用户都可以修改版本中的数据集。</bullet_item><para/>
        ///     <bullet_item>受保护（只有所有者可以编辑）- 任何用户都可以查看版本，但只有所有者或地理数据库管理员可以编辑版本中的一个或多个数据集。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Access Permission")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _access_permission_value _access_permission { get; set; } = _access_permission_value._PRIVATE;

        public enum _access_permission_value
        {
            /// <summary>
            /// <para>Private (owner  only)</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("Private (owner  only)")]
            [GPEnumValue("PRIVATE")]
            _PRIVATE,

            /// <summary>
            /// <para>Public (any user)</para>
            /// <para>Public (any user)—Any user can view the version. Any user who has been granted read/write (update, insert, and delete) permissions on datasets can modify datasets in the version.</para>
            /// <para>公开（任何用户）- 任何用户都可以查看版本。任何被授予数据集读/写（更新、插入和删除）权限的用户都可以修改版本中的数据集。</para>
            /// </summary>
            [Description("Public (any user)")]
            [GPEnumValue("PUBLIC")]
            _PUBLIC,

            /// <summary>
            /// <para>Protected (only the owner can edit)</para>
            /// <para>Protected (only the owner can edit)—Any user can view the version, but only the owner or the geodatabase administrator can edit the version or datasets in the version.</para>
            /// <para>受保护（只有所有者可以编辑）- 任何用户都可以查看版本，但只有所有者或地理数据库管理员可以编辑版本中的一个或多个数据集。</para>
            /// </summary>
            [Description("Protected (only the owner can edit)")]
            [GPEnumValue("PROTECTED")]
            _PROTECTED,

        }

        /// <summary>
        /// <para>Updated Input Workspace</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Input Workspace")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_workspace { get; set; }


        public CreateVersion SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}